<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main2" />
    <g:set var="entityName" value="${message(code: 'campaignTeam.label', default: 'campaignTeam')}" />
    <title>团队市场活动</title>
</head>

<body>
    <div class="main-body">
        <div class="page-wrapper">
            <!-- Page-header start -->
            <div class="page-header">
                <div class="page-header-title">
                    <h4>团队市场活动</h4>
                </div>

                <div class="page-header-breadcrumb">
                    <ul class="breadcrumb-title">
                        <li class="breadcrumb-item">
                            <a href="/salesDashboard/index">
                                <i class="icofont icofont-home"></i>
                            </a>
                        </li>
                        <li class="breadcrumb-item"><a href="#!">团队市场活动</a>
                        </li>
                    </ul>
                </div>
            </div>
            <!-- Page-header end -->
            <!-- Page-body start -->
            <div class="page-body">
                <!-- Hover table card start -->
                <div class="card">
                    <div class="card-header">
                        <h5>团队市场活动</h5>

                        <div class="card-header-right">
                            %{-- <i class="icofont icofont-rounded-down"></i> --}%
                        </div>
                    </div>

                    <div class="card-block dt-responsive">

                        <div class="table-responsive">
                            <div id="dom-jqry_wrapper" class="dataTables_wrapper dt-bootstrap4">

                                <g:form method="POST" action="searchCampaignTeam">
                                    <div class="row m-0">
                                        <div class="col-md-8 p-l-0">
                                            <div id="order-table_filter" class="dataTables_filter text-left">
                                                <label>搜索
                                                    <input type="text" class="form-control" placeholder="活动名称" name="name" id="name" value="${params?.name}">
                                                    <input type="text" class="form-control" placeholder="活动类型" name="type" id="type" value="${params?.type}">
                                                </label>
                                            </div>
                                        </div>
                                        <div class="col-md-4 p-r-0 dt-buttons text-right">
                                            <button class="btn btn-inverse btn-sm btn-squeare" type="submit"><i class="fa fa-search"></i></button>
                                            <button class="btn btn-inverse btn-sm btn-squeare" type="button" id="resetBtn"><i class="fa fa-refresh"></i></button>
                                        </div>
                                    </div>

                                </g:form>
                                <!--
                          <g:form method="POST" action="exportCampaignTeam">
                                <div class="row m-0">
                                    <input type="hidden" class="form-control" placeholder="活动名称" name="name" id="exportName" value="${params?.name}">
                                    <input type="hidden" class="form-control" placeholder="活动类型" name="type" id="exportType" value="${params?.type}">
                                    <input type="hidden" class="form-control" placeholder="文件类型" name="f" value="excel">
                                    <input type="hidden" class="form-control" placeholder="后缀" name="extension" value="xls">
                                    <div class="col-md-12 p-r-0 dt-buttons text-right">
                                    <button class="btn btn-success btn-mini" type="submit"><i class="icofont icofont-search"></i>导出
                                    </button>
                                </div>
                                </div>
                            </g:form> -->

                                <table class="table table-striped  table-bordered table-hover">
                                    <thead>
                                        <tr>
                                            <g:sortableColumn property="fullName" title="活动名称" />
                                            <g:sortableColumn property="fullName" title="活动类型" />
                                            <g:sortableColumn property="user" title="所有者" />
                                            <g:sortableColumn property="user" title="权限" />
                                            <g:sortableColumn property="createBy" title="创建人" />
                                            <g:sortableColumn property="modifyBy" title="修改人" />
                                            <g:sortableColumn property="createdDate" title="创建时间" />
                                            <g:sortableColumn property="modifiedDate" title="修改时间" />
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <g:each in="${campaignTeamList}">
                                            <tr>
                                                <td>
                                                    <g:link controller="campaign" action="show" id="${it?.campaign?.id}">${it?.campaign?.name}</g:link>
                                                </td>
                                                <td>${it?.campaign?.type?.name}</td>
                                                <td>${it?.user?.fullName}</td>
                                                <td>${it?.teamRole?.name}</td>
                                                <td>${it.createBy}</td>
                                                <td>${it.modifyBy}</td>
                                                <td>
                                                    <g:formatDate date="${it?.createdDate}" format="yyyy-MM-dd HH:mm:ss"></g:formatDate>
                                                </td>
                                                <td>
                                                    <g:formatDate date="${it?.modifiedDate}" format="yyyy-MM-dd HH:mm:ss"></g:formatDate>
                                                </td>
                                            </tr>
                                        </g:each>
                                    </tbody>
                                </table>

                                <div class="dataTables_paginate">
                                    <div class="pagination">
                                        <g:paginate total="${campaignTeamCount ?: 0}" params="${params}" />
                                    </div>
                                </div>
                            </div>

                        </div>

                    </div>
                </div>
                <!-- Hover table card end -->
            </div>

            <!-- Page-body end -->
        </div>
    </div>
    <g:javascript>
        $(function() { $("#resetBtn").click(function () { $("#name").val(""); $("#type").val(""); }) });
    </g:javascript>
</body>

</html>
